Initial Values
You can assign initial values to channels and/or parameters at different places:
When the same channel or parameter is used at these places with different initial values, the following hierarchy applies: Init Values mapping flavor > Initial Values view > Declaration Editor. For example, if a channel or parameter value is set to 3 in the Initial Values view but to 1 in the Declaration Editor, the value in the Initial Values view prevails.
double
, float
, int
, boolean
).Initial values (default values) assigned in the Declaration Editor
Each channel and each parameter has a default value that can be changed in the Declaration Editor. The default value acts as initial value as long as you do not define a specific initial value. To edit the default value, select a signal in the Declaration Editor, go to the General tab and enter the new value in the Value field. Multiple selection is possible.
Initial values assigned in the Initial Values view
The Initial Values view is used to assign initial values to channels and/or parameters. Initial value can be specified for the following elements.
Element | Description |
---|---|
variant | The initial values are only valid for this variant. |
variant folder | Variants in this folder take over the initial values set here except a variant where initial values are already specified. They keep them. |
test case | The initial values are only valid for this test case. |
test case folder | Test cases in that folder take over the initial values set here except a test case where initial values are already specified. They keep them. |
Select a test case in the Project view. Go to the Initial Values view and click Add one initial values definition row. Press Ctrl+Space to use the autocompletion feature and select a channel or parameter. Click in the value field and enter the new value, or use the three dots button "..." to the right to open the Value Editor, see Value Editor.
Or, click Select and select all channels and parameters whose initial values you want to change.
You can also assign values to struct or array elements.
Instead of entering initial value definitions manually, you can use the environment variable ${tpt.scenario.attribute.<attribute_name>}
to enter the value of a Test Case Details view attribute. The Test Case Details view attribute value can be different from test case to test case, see Test Case Details - Edit Test Case Attributes.
To copy and paste individual initial values, select the initial value definitions in the Initial Values view and press Ctrl+C to copy them. Select another test case or test cases folder in the Project view, select the Initial Values view again and press Ctrl+V to insert the copied initial values. When using the Import signal step, you can copy the first value of a signal from an external file as initial value to a signal in TPT for a test case, see Copy to initial values.
Initial values assigned in the Init Values mapping flavor
The Init Values mapping flavor is used to specify initial values of signals. The mapping is created and specified in the Declaration Editor, see Mapping Flavor - Init Values. Other than the default values of a signal, these initial values are only applied during the test execution when the mapping is selected in the test platform.
The values specified prevail all other initial value specifications except for the values that act as initial values in the test specification in the Content view.
Initial values assigned in a step list
Values that are specified at the beginning of a step list, act as initial values.
Your initial values specification must end with a Wait step, see Step Type - Wait.